import {
	http
} from '../httpIndex.js'

export default {
	// 展示宿舍报修列表 app/Repair/getAppRepair
	getAppRepair(buildingNo, storey, repairDate) {
		return http.get(`app/Repair/getAppRepair?buildingNo=${buildingNo}&storey=${storey}&repairDate=${repairDate}`)
	},
	// 展示宿舍报修列表 app/ManualAttence/getAppDorListByStorey
	getAppDorListByStorey(buildingNo, storey) {
		return http.get(`app/ManualAttence/getAppDorListByStorey?buildingNo=${buildingNo}&storey=${storey}`)
	},

	// 各状态的报修单数 /app/Repair/getAppRepairCount
	getAppRepairCount() {
		return http.get("app/Repair/getAppRepairCount")
	},
	//  历史报修列表 /app/Repair/getAppHistoryRepList
	getAppHistoryRepList() {
		return http.get("app/Repair/getAppHistoryRepList")
	},
	// 展示最新报修列表 /app/Repair/getAppNewRepairList
	getAppNewRepairList() {
		return http.get('app/Repair/getAppNewRepairList')
	},
	// 展示处理中报修列表app/Repair/getAppProcessRepList
	getAppProcessRepList() {
		return http.get("app/Repair/getAppProcessRepList")
	},
	// 根据报修Id查询详细信息 app/Repair/getRepairInfoById
	getRepairInfoById(repairId) {
		return http.get(`app/Repair/getRepairInfoById?repairId=${repairId}`)
	},
	// 确认维修  完成维修 app/Repair/updateRepairStatus
	updateRepairStatus(userId, id, status, deviceIds, repairDesc) {
		return http.post(
			`app/Repair/updateRepairStatus?userId=${userId}&id=${id}&status=${status}&deviceIds=${deviceIds}&repairDesc=${repairDesc}`
		)
	},
	// 获取班级报修列表  app/ClassRepair/getAllClassRepairList
	getAllClassRepairList() {
		return http.get("app/ClassRepair/getAllClassRepairList")
	},
	// 根据宿舍Id查询历史报修列表 app/Repair/getAppHisRepListByBId
	getAppHisRepListByBId(bdormitoryId) {
		return http.get(`app/Repair/getAppHisRepListByBId?bdormitoryId=${bdormitoryId}`)
	},
	// 根据宿舍Id查询最新报修列表 app/Repair/getNewRepairInfoById
	getNewRepairInfoById(bdormitoryId) {
		return http.get(`app/Repair/getNewRepairInfoById?bdormitoryId=${bdormitoryId}`)
	},
	// 查询班级报修数量 /app/ClassRepair/getClassRepairAllCount
	getClassRepairAllCount() {
		return http.get("app/ClassRepair/getClassRepairAllCount")
	},
	// 班级维修最新列表 app/ClassRepair/getAppNewClassRepairList
	getAppNewClassRepairList() {
		return http.get("app/ClassRepair/getAppNewClassRepairList")
	},
	// 班级处理中列表 app/ClassRepair/getAppProcessClassRepList
	getAppProcessClassRepList() {
		return http.get("app/ClassRepair/getAppProcessClassRepList")
	},
	// 班级维修历史记录 app/ClassRepair/getAppHistoryClassRepList
	getAppHistoryClassRepList() {
		return http.get("app/ClassRepair/getAppHistoryClassRepList")
	},
	// app/ClassRepair/getClassRepairInfoById 班级维修详情
	getClassRepairInfoById(repairId) {
		return http.get(`app/ClassRepair/getClassRepairInfoById?repairId=${repairId}`)

	},
	//  确认班级维修 app/ClassRepair/updateClassRepair
	updateClassRepair(id, status, deviceIds, repairDesc) {
		return http.post("app/ClassRepair/updateClassRepair", {
			id: id,
			status: status,
			deviceIds: deviceIds,
			repairDesc: repairDesc
		})
	},
	// 宿舍报修 不带图片  /app/Repair/createRepair
	createRepair(userId, bdormitoryId, deviceIds, repairDesc, status, repairBy, isDuty) {
		return http.post("app/Repair/createRepair", {
			repairUserId: userId,
			bdormitoryId: bdormitoryId,
			deviceIds: deviceIds,
			repairDesc: repairDesc,
			status: status,
			repairBy: repairBy,
			isDuty: isDuty
		})
	},
	// 班级报修 不带图片  app/ClassRepair/createClassRepair
	createClassRepair(classId, createBy, deviceIds, repairDesc, status, isDuty, repairUserId) {
		return http.post("app/ClassRepair/createClassRepair", {
			repairUserId: repairUserId,
			classId: classId,
			createBy: createBy,
			deviceIds: deviceIds,
			repairDesc: repairDesc,
			status: status,
			isDuty: isDuty
		})
	},

	updateClassRepairUpload(data) {
		return http.post(
			`app/ClassRepair/updateClassRepairUpload`, data
		)
	},



	deleteRepair(data) {
		return http.post(
			`app/Repair/deleteRepair`, data
		)
	},

}